/**
 *
 * @author 
 *
 */
class Soldier extends egret.DisplayObjectContainer {
    
    public name: string = "";
    private hp: number = 100;
    private moveSpeed: number = 1;
    private maxHp: number = 100;
    
	public constructor(_name:string,_moveSpeed:number) {
        super();
        this.name = _name;
        this.hp = 100;
        this.moveSpeed = _moveSpeed;
        this.addEventListener(egret.Event.ADDED_TO_STAGE,this.onAddToStage,this);
	}
	
    private onAddToStage(event: egret.Event) {
    
        var data = RES.getRes("10000005_json");
        var tex = RES.getRes("10000005_png");
        var mcf: egret.MovieClipDataFactory = new egret.MovieClipDataFactory(data,tex);
        var mymc:egret.MovieClip = new egret.MovieClip(mcf.generateMovieClipData("soldier_10000005"));
        this.addChild(mymc);
        
        //mymc.gotoAndPlay(4);
        
    }
	private init():void{
	    
	}
	
	private stand():void{
	    
	}
	
	private move():void{
	    
	}
	
	private dead():void{
	    
	}
	
	private attack():void{
	    
	}
	
	private attacked():void{
        this.hp -= 10;
	}
	
	
    private enterFrame(event: egret.MovieClipEvent,frameIndex: number): void {
        console.log("-------------");
        console.log(event.type,event.frameLabel,frameIndex);//frame_label @fall 6
        console.log("-------------");
        //var loader: egret.URLLoader = <egret.URLLoader>event.target;
        //var textture = <egret.Texture>loader.data;
    }
    
}
